package com.mydesignpattern.beijing.composite.file;

import com.mydesignpattern.beijing.composite.MyFile;

/**
 * txt文件
 */
public class MyTxtFile extends MyFile {

    public MyTxtFile(){}
    public MyTxtFile(String name){
        this.name = name;
    }

    /**
     * 打印所有子文件名称
     */
    public void printFiles(){
        System.out.println("    "+this.name);
    }

    /**
     * 添加子文件
     */
    public void addFile(){
        throw new RuntimeException("file not support add operation");
    }

    /**
     * 删除子文件
     * @param name
     */
    public void removeFile(String name){
        throw new RuntimeException("file not support delete operation");
    }

}
